Skip to content

fix(runs): remove a whole-file write's temp file in its folder after a rename - #816

Merged
harenome merged 1 commit into
ThinkFlowLab:mainfrom
harenome:fix/part-after-rename
Dec 3, 2026
Merged

harenome merged 1 commit into
ThinkFlowLab:mainfrom
harenome:fix/part-after-rename

Conversation

@harenome

@harenome harenome commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Closes #799

What

A write whose folder was renamed mid-write left its hidden .part file in the moved folder: cleanup used the old path.

ondisk.write_whole now holds a search handle on the folder (O_PATH on Linux), creating and removing the .part through it. A folder it cannot hold, or whose handle took the last descriptor, is written by name, as before.

Touches

  • app/nullius/ondisk.py
  • app/tests/test_ondisk.py: renamed folder keeps no .part (fails on main); 0300, unopenable and one-free-descriptor writes still publish; no descriptor leak

Verified

  • Main: renaming workspace c to moved during its cache write left moved/jobs/.<hex>.part. Now empty.
  • Backend and route suites.

Risk

Low. Atomic replace and modes unchanged; no write main allowed is refused. Without O_PATH/O_SEARCH, an unreadable folder keeps the old cleanup by name.

Agents

Claude Code, Opus 5.5
Codex, GPT-6.2-Astra (review)

@harenome
harenome marked this pull request as ready for review December 3, 2026 21:43
@github-actions github-actions Bot added the needs review Tests pass, no conflict, no verdict on its latest commit label Dec 3, 2026
@harenome
harenome merged commit f9f076a into ThinkFlowLab:main Dec 3, 2026
4 checks passed
@harenome
harenome deleted the fix/part-after-rename branch December 3, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Tests pass, no conflict, no verdict on its latest commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workspaces: a rename during a cache write leaves a hidden .part file in the moved workspace

1 participant